package com.xykj.service.impl;

import com.xykj.mapper.SectorFundFlowMapper;
import com.xykj.pojo.dto.SectorFundFlowDto;
import com.xykj.service.SectorFundFlowService;
import com.xykj.web.enums.DirectionEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class SectorFundFlowServiceImpl  implements SectorFundFlowService {
    @Autowired
    private SectorFundFlowMapper sectorFundFlowMapper;

    @Override
    public List<SectorFundFlowDto> querySectorFundFlowByStatus() {
        List<SectorFundFlowDto> upSectorFundFlowDto = sectorFundFlowMapper.querySectorFundFlowByStatus(DirectionEnum.UP.getStatus());
        List<SectorFundFlowDto> downSectorFundFlowDto = sectorFundFlowMapper.querySectorFundFlowByStatus(DirectionEnum.DOWN.getStatus());
        upSectorFundFlowDto.addAll(downSectorFundFlowDto);
        return upSectorFundFlowDto;
    }
}
